#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);

void solve() {
	int n, k;
	cin >> n >> k;
	vector<double> a(n);
	for (int i = 0; i < n; i++)
	{
		int x, y;
		cin >> x >> y;
		a[i] = atan2(x, y);
	}
	if (n == k)
	{
		printf("%.10lf\n", 2 * pi);
		return;
	}
	sort(a.begin(), a.end());
	double ans = 0;
	for (int i = 0; i < n; i++) a.push_back(a[i] + 2 * pi);
	for (int i = 0; i < n; i++) ans = max(ans, a[i + k] - a[i]);
	printf("%.10lf\n", ans);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout.tie(0);
	int T = 1;
	cin >> T;
	while (T--)
	{
		solve();
	}
	return 0;
}